//
//  PhotoViewCell.swift
//  lookLikeIweekly
//
//  Created by Mainzxq on 16/6/6.
//  Copyright © 2016年 Mainzxq. All rights reserved.
//

import UIKit

class PhotoViewCell: UICollectionViewCell {
    
    var isChoose: Bool = false {
        didSet{
            selectBtn.selected = isChoose
        }
    }
    var imageView = UIImageView()
    var selectBtn = UIButton()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.contentView.backgroundColor = UIColor.whiteColor()
        imageView.frame = self.bounds
        selectBtn.frame.origin = CGPoint(x: self.frame.size.width-20, y: 2)
        selectBtn.frame.size = CGSize(width: self.bounds.size.width/5, height: self.bounds.size.height/5)
        selectBtn.setImage(UIImage(named: "unselect"), forState: .Normal)
        selectBtn.setImage(UIImage(named: "selected"), forState: .Selected)
        selectBtn.selected = false
        self.contentView.addSubview(imageView)
        self.contentView.addSubview(selectBtn)
        //self.bringSubviewToFront(cover)
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        print("layOut")
    }
}
